<?xml version="1.0" ?>
<xsd:schema 
   targetNamespace="http://www.someserver.com/myns"
   xmlns:myns="http://www.someserver.com/myns"
   xmlns:abc="http://www.someserver.com/abc"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   elementFormDefault="qualified"
   version="2.0.0">

   <xsd:import namespace="http://www.opengis.net/gml/3.2"
               schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>

   <xsd:import namespace="http://www.someserver.com/abc"
               schemaLocation="RoadSchema.xsd"/>

   <xsd:simpleType name="MaleOrFemale">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="male"/>
         <xsd:enumeration value="female"/>
         <xsd:enumeration value="m"/>
         <xsd:enumeration value="f"/>
      </xsd:restriction>
   </xsd:simpleType>

   <!-- =============================================
        Address
        ============================================= -->
   <xsd:element name="Address"
                type="myns:AddressType"/>
   <xsd:complexType name="AddressType">
      <xsd:sequence>
         <xsd:element name="streetName" type="xsd:string"/>
         <xsd:element name="streetNumber" type="xsd:string"/>
         <xsd:element name="city" type="xsd:string"/>
         <xsd:element name="province" type="xsd:string"/>
         <xsd:element name="postalCode" type="xsd:string"/>
         <xsd:element name="country" type="xsd:string"/>
      </xsd:sequence>
      <xsd:attribute ref="gml:id" use="required"/>
   </xsd:complexType>
   <xsd:complexType name="AddressPropertyType">
      <xsd:sequence>
         <xsd:element ref="myns:Address" minOccurs="0"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="gml:AssociationAttributeGroup"/>
   </xsd:complexType>

   <!-- =============================================
        House
        ============================================= -->
   <xsd:element name="House"
                type="myns:HouseType"
                substitutionGroup="gml:AbstractFeature"/>
   <xsd:complexType name="HouseType">
      <xsd:complexContent>
         <xsd:extension base="gml:AbstractFeatureType">
            <xsd:sequence>
               <xsd:element name="numFloors" type="xsd:nonNegativeInteger"/>
               <xsd:element name="area" type="xsd:nonNegativeInteger"/>
               <xsd:element name="location" type="gml:PointPropertyType"/>
               <xsd:element name="frontsOn" type="gml:ReferenceType"/>
               <xsd:element name="address" type="myns:AddressPropertyType"/>
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>

   <!-- =============================================
        Car    
        ============================================= -->
   <xsd:element name="Car"
                type="myns:CarType"
                substitutionGroup="gml:AbstractFeature"/>
   <xsd:complexType name="CarType">
      <xsd:complexContent>
         <xsd:extension base="gml:AbstractFeatureType">
            <xsd:sequence>
               <xsd:element name="model" type="xsd:string"/>
               <xsd:element name="age" type="xsd:nonNegativeInteger"/>
               <xsd:element name="colour" type="xsd:string"/>
               <xsd:element name="location" type="gml:PointPropertyType"/>
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>

   <!-- =============================================
        Person
        ============================================= -->
   <xsd:element name="Person"
                type="myns:PersonType"
                substitutionGroup="gml:AbstractFeature"/>
   <xsd:complexType name="PersonType">
      <xsd:complexContent>
         <xsd:extension base="gml:AbstractFeatureType">
            <xsd:sequence>
               <xsd:element name="lastName" type="xsd:string"/>
               <xsd:element name="firstName" type="xsd:string"/>
               <xsd:element name="age" type="xsd:nonNegativeInteger"/>
               <xsd:element name="sex" type="myns:MaleOrFemale"/>
               <xsd:element name="spouse"
                            type="gml:ReferenceType" minOccurs="0"/>
               <xsd:element name="location" type="gml:PointPropertyType"/>
               <xsd:element name="mailAddress" 
                            type="myns:AddressPropertyType"/>
               <xsd:element name="phone"
                            type="xsd:string" maxOccurs="unbounded"/>
               <xsd:element name="livesIn"
                            type="gml:ReferenceType" minOccurs="0"/>
               <xsd:element name="isDriving"
                            type="gml:ReferenceType" minOccurs="0"/>
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>

</xsd:schema>
